//This example shows a simple "Hello world!" on a VGA screen.
//You need to connect a VGA screen cable to the pins specified below.
//cc by-sa 4.0 license
//bitluni

#include <ESP32Lib.h>
#include <Ressources/Font6x8.h>
#include <Ressources/Font8x8.h>

//pin configuration
const int redPin = 14;
const int greenPin = 19;
const int bluePin = 27;
const int hsyncPin = 32;
const int vsyncPin = 33;

//VGA Device
VGA3Bit vga;


void setup() {
  Mode myMode = vga.MODE640x480.custom(312, 235);
  //print the parameters
  myMode.print<HardwareSerial>(Serial);
  //initializing vga at the specified pins
  vga.init(myMode, redPin, greenPin, bluePin, hsyncPin, vsyncPin);
  //selecting the font
  vga.setFont(Font6x8);  //设置字库
  vga.setTextColor(vga.RGB(0, 255, 0));
  vga.setCursor(100, 0);  //光标位置
  vga.println("Hello World!");

  vga.setFont(Font8x8);  //设置字库
  vga.setTextColor(vga.RGB(255, 255, 255));
  vga.setCursor(100, vga.yres / 2);  //光标位置
  vga.println("2024-03-07 22:21");
}

void loop() {
}